//
//  NXTPadController.h
//
//  Created by Jean-Luc Béchennec on 18/03/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import  <IOBluetoothUI/objc/IOBluetoothDeviceSelectorController.h>

#import <WiiRemote/WiiRemote.h>
#import <WiiRemote/WiiRemoteDiscovery.h>


#define NXT_RFCOMM_CHANNEL_ID   1

@interface NXTPadController : NSObject  {
  IBOutlet id padBox; 
	IBOutlet id affichageDistance;
	IBOutlet id Distance;
	 IBOutlet id window;

 

	//
	//
	int rightPredState;
	int leftPredState;

  int connectionState;
  int position;
	IOBluetoothDeviceRef btDevice;
	BluetoothDeviceName         btName;
	CFStringRef                 name;
	char                        raw_name[100];
	char	cmd[100];
	IOBluetoothRFCOMMChannelRef rfcommChannel;
	int                         new_data;
	
	int state;
	//ADD
	IOBluetoothDevice *mBluetoothDevice;
	IOBluetoothRFCOMMChannel *mRFCOMMChannel;
	
	
	// WIIMOTE
	//WiiRemoteDiscovery * disc;
	WiiRemoteDiscovery *discovery;
    //WiiRemote *wii;
	BOOL boutonisPressed;
	
	
	
}
- (IBAction)backward:(id)sender;
- (IBAction)forward:(id)sender;
- (IBAction)turnLeft:(id)sender;
- (IBAction)turnRight:(id)sender;

- (IBAction)stopMove:(id)sender;
- (IBAction)toggleConnect:(id)sender;
- (IBAction)wiiConnect:(id)sender;

- (IBAction)goTo:(id)sender ;

//WIIMOTE
//-(IBOutlet) (NSButton *) rightBouton;
@end
void listener(IOBluetoothRFCOMMChannelRef rfcommChannel, void *data, UInt16 length, void *refCon);

